﻿@using PAMD.Business.Models
@model LoginModel
@{
    ViewBag.Title = SiteConstant.Slogan;
    Layout = "../Shared/_Layout.cshtml";
}
<script type="text/javascript" language="javascript">

    $(document).ready(function (event) {

        $('#SaveButton').click(function () {

            var validated = ValidateForm();
            return validated;
        });

    });

</script>
@using (Html.BeginForm("Login", "Account", new { ReturnUrl = Request.QueryString["ReturnUrl"] }))
{
    <div class="form-container-small">
        <strong>Sign In</strong>
        <fieldset class="field-container">
            @if (!ViewData.ModelState.IsValid)
            {
                <div class="error-box">
                    The E-Mail or password provided is incorrect, Please try again.
                </div>
            }
            <div class="left-align">
                <div class="controlBox">
                    Don't have an account? @Html.ActionLink("Create one now", "Index", "Register") &nbsp;
                    &nbsp;&nbsp;@Html.ActionLink("Forgot password", "ForgotPassword", "Account")
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Username">
                        Email</label>
                    @Html.TextBoxFor(m => m.Email, new { validation = "required,email", @class = "inputBox" })
                </div>
                <div id="Username_Error" class="error-box">
                    Please enter valid email address.
                </div>
            </div>
            <div class="left-align">
                <div class="controlBox">
                    <label for="Password">
                        Password</label>
                    @Html.PasswordFor(m => m.Password, new { @class = "inputBox", validation = "required" })
                </div>
                <div id="Password_Error" class="error-box">
                    Please enter password, Min 4 character.
                </div>
            </div>
            <div>
                @Html.CheckBoxFor(m => m.KeepSign, new { style = "margin-left: 150px;float: none;" })
                <label for="KeepSign" style="float: none;">
                    Keep me logged in</label>&nbsp;
                <input type="submit" id="SaveButton" style="margin-left: 50px;" value="Sign In" />
            </div>
        </fieldset>
    </div>
}